@using DNA.Mvc.Text
@model System.Web.Profile.ProfileBase
@{  
    Ajax.Dna().Widget()
        .Content(@<text>
    @if (Model != null)
    { 
        <table style="width: 100%">
            <tr>
                <td align="center" colspan="2">
                    <h4 style="padding: 5px;">
                        @{var _dispName = ((Model["DisplayName"] != null) && (!string.IsNullOrEmpty(Model["DisplayName"].ToString()))) ? Model["DisplayName"] : Model.UserName;}
                        @_dispName
                    </h4>
                </td>
            </tr>
            @{var avatar=Url.Content("~/content/images/no-avatar.gif");}
            @if ((Model["Avatar"] != null) && (!string.IsNullOrEmpty(Model["Avatar"].ToString())))
            {
                 avatar= Model["Avatar"].ToString();
            }
                <tr>
                    <td colspan="2" align="center">
                        <div class="ui-corner-all d-avatar" style="display:inline-block;">
                        <img src="@avatar" alt="" class="ui-corner-all" />
                        </div>
                    </td>
                </tr>
            @if ((Model["Location"] != null) && (!string.IsNullOrEmpty(Model["Location"].ToString())))
            {
                <tr>
                    <td style="min-width: 80px;">
                        @Html.Global("RES_LOCATION"):
                    </td>
                    <td>
                        @Model["Location"]
                    </td>
                </tr>
            }
            <tr>
                <td>
                    @Html.Global("RES_REGISTERED"):
                </td>
                <td>
                    @Html.Global(Membership.GetUser(Model.UserName).CreationDate)
                </td>
            </tr>
            <tr>
                <td >
                    @Html.Global("RES_LAST_LOGIN"):
                </td>
                <td>
                    @Html.Global(Model.LastActivityDate)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <ul class="ui-helper-reset">
                        @if ((Model["WebSite"] != null) && (!string.IsNullOrEmpty(Model["WebSite"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@Model["WebSite"].ToString()">
                                <span class="forum-icon forum-icon-web"></span></a></li>
                        }
                        @if ((Model["MSN"] != null) && (!string.IsNullOrEmpty(Model["MSN"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="#"><span class="forum-icon forum-icon-msn">
                            </span></a></li>}
                        @if ((Model["Yahoo"] != null) && (!string.IsNullOrEmpty(Model["Yahoo"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="http://edit.yahoo.com/config/send_webmesg?.target=@Model["Yahoo"].ToString()&.src=pg">
                                <span class="forum-icon forum-icon-yahoo"></span></a></li>}
                        @if ((Model["Email"] != null) && (!string.IsNullOrEmpty(Model["Email"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="javascript:portal.mail('@Model["Email"].ToString()');void(0);)">
                                <span class="forum-icon forum-icon-email"></span></a></li> }
                        @if ((Model["Blog"] != null) && (!string.IsNullOrEmpty(Model["Blog"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@Model["Blog"].ToString()">
                                <span class="forum-icon forum-icon-blog"></span></a></li>
                        }
                        @if ((Model["ICQ"] != null) && (!string.IsNullOrEmpty(Model["ICQ"].ToString())))
                        {
                            <li style="float: left; padding: 1px;"><a target="_blank" href="@Model["ICQ"].ToString()">
                                <span class="forum-icon forum-icon-icq"></span></a></li>
                        }
                    </ul>
                </td>
            </tr>
            @if ((Model["Signature"] != null) && (!string.IsNullOrEmpty(Model["Signature"].ToString())))
            { 
                <tr>
                    <td colspan="2">
                        @TextEngine.SafeHtml(Model["Signature"].ToString())
                    </td>
                </tr>
            }
        </table>
    }
    else
    { 
        <div style="padding: 10px;">
            You are not login yet.
            @Html.ActionLink("Register", "Register", "Account", new { Area = "" }, null)
            or
            @Html.ActionLink("Login", "Login", "Account", new { Area = "" }, null)
            now.
        </div>
    }
    </text>)
.Preview(@<text>
    <table style="width: 100%">
        <tr>
            <td align="center" colspan="2">
                <h4 style="padding: 5px;">
                    User name
                </h4>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <img src="@Url.Content("~/content/images/no-avatar.gif")" alt="" class="ui-corner-all" />
            </td>
        </tr>
        <tr>
            <td style="min-width: 80px;">
                @Html.Global("RES_LOCATION"):
            </td>
            <td>
                USA
            </td>
        </tr>
        <tr>
            <td>
                @Html.Global("RES_REGISTERED"):
            </td>
            <td>
                @Html.Global(DateTime.Now)
            </td>
        </tr>
        <tr>
            <td style="white-space:nowrap;">
                @Html.Global("RES_LAST_LOGIN"):
            </td>
            <td>
                @Html.Global(DateTime.Now)
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <ul class="ui-helper-reset">
                    <li style="float: left; padding: 1px;"><a target="_blank" href="http://www.dotnetage.com">
                        <span class="forum-icon forum-icon-web"></span></a></li>
                    <li style="float: left; padding: 1px;"><a target="_blank" href="#"><span class="forum-icon forum-icon-msn">
                    </span></a></li>
                    <li style="float: left; padding: 1px;"><a target="_blank" href="#"><span class="forum-icon forum-icon-yahoo">
                    </span></a></li>
                    <li style="float: left; padding: 1px;"><a target="_blank" href="javascript:void(0);">
                        <span class="forum-icon forum-icon-email"></span></a></li>
                    <li style="float: left; padding: 1px;"><a target="_blank" href="#"><span class="forum-icon forum-icon-blog">
                    </span></a></li>
                    <li style="float: left; padding: 1px;"><a target="_blank" href="#"><span class="forum-icon forum-icon-icq">
                    </span></a></li>
                </ul>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                Here is user signature
            </td>
        </tr>
    </table>
    </text>)
        .Render();
}
